package cn.haohaowo;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.haohaowo.bean.Person;
import cn.haohaowo.service.PersonService;

@RestController
public class PersonController {

	@Autowired
	private PersonService personService;
	
	@RequestMapping("/save.do")
	public List<Person> savePerson(String name, String sex, String age, String tel) {
		Person person = new Person();
		person.setName(name);
		person.setSex(sex);
		person.setAge(age);
		person.setTel(tel);
		person = personService.savePerson(person);
		return personService.findAllPerson();
	}
}
